function initHotPost() {
    let li = getMainBarMount()
    li.innerHTML = `
            <div id="hot-bar-title">热度最高</div>
            <div id="hot-bar-list">
            </div>        
    `
    loadHotPost()
}


function loadHotPost() {
    let hotBarList = document.querySelector("#hot-bar-list")
    ajax("get", "/post/gethotpost", null, function (json) {

        // console.log(json.data);

        let htmlData = json.data.map(({postId, postTitle}) => {
            return `
				<a href="${window.webUrl}/postInfo.html?postId=${postId}">
					<div>${postTitle}</div>
				</a>
			`
        })
        let insertHtml = ""
        for (var i = 0; i < htmlData.length; i++) {
            insertHtml += htmlData[i]
        }
        hotBarList.innerHTML = insertHtml
    }, null)
}